/**
 * <copyright>
 * </copyright>
 *

 */
package net.maylander.bfcpublog.bfwb.brainfuckLanguage.impl;

import net.maylander.bfcpublog.bfwb.brainfuckLanguage.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class BrainfuckLanguageFactoryImpl extends EFactoryImpl implements BrainfuckLanguageFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static BrainfuckLanguageFactory init()
  {
    try
    {
      BrainfuckLanguageFactory theBrainfuckLanguageFactory = (BrainfuckLanguageFactory)EPackage.Registry.INSTANCE.getEFactory("http://bfcpublog.maylander.net/bfwb/BrainfuckLanguage"); 
      if (theBrainfuckLanguageFactory != null)
      {
        return theBrainfuckLanguageFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new BrainfuckLanguageFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BrainfuckLanguageFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case BrainfuckLanguagePackage.BRAINFUCK_PROGRAM: return createBrainfuckProgram();
      case BrainfuckLanguagePackage.SYMBOL_DEF: return createSymbolDef();
      case BrainfuckLanguagePackage.ABSTRACT_MACRO_DEF: return createAbstractMacroDef();
      case BrainfuckLanguagePackage.REGION: return createRegion();
      case BrainfuckLanguagePackage.MACRO_DEF: return createMacroDef();
      case BrainfuckLanguagePackage.PARAM_DEF: return createParamDef();
      case BrainfuckLanguagePackage.ABSTRACT_STMT: return createAbstractStmt();
      case BrainfuckLanguagePackage.SIMPLE_STMT: return createSimpleStmt();
      case BrainfuckLanguagePackage.LOOP_STMT: return createLoopStmt();
      case BrainfuckLanguagePackage.MACRO_CALL: return createMacroCall();
      case BrainfuckLanguagePackage.BF_VALUE: return createBfValue();
      case BrainfuckLanguagePackage.SIGNED_INT: return createSignedInt();
      case BrainfuckLanguagePackage.ABSTRACT_PARAM_DEF: return createAbstractParamDef();
      case BrainfuckLanguagePackage.BLOCK_STMT: return createBlockStmt();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object createFromString(EDataType eDataType, String initialValue)
  {
    switch (eDataType.getClassifierID())
    {
      case BrainfuckLanguagePackage.SIMPLE_STMT_KIND:
        return createSimpleStmtKindFromString(eDataType, initialValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String convertToString(EDataType eDataType, Object instanceValue)
  {
    switch (eDataType.getClassifierID())
    {
      case BrainfuckLanguagePackage.SIMPLE_STMT_KIND:
        return convertSimpleStmtKindToString(eDataType, instanceValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BrainfuckProgram createBrainfuckProgram()
  {
    BrainfuckProgramImpl brainfuckProgram = new BrainfuckProgramImpl();
    return brainfuckProgram;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SymbolDef createSymbolDef()
  {
    SymbolDefImpl symbolDef = new SymbolDefImpl();
    return symbolDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AbstractMacroDef createAbstractMacroDef()
  {
    AbstractMacroDefImpl abstractMacroDef = new AbstractMacroDefImpl();
    return abstractMacroDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Region createRegion()
  {
    RegionImpl region = new RegionImpl();
    return region;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public MacroDef createMacroDef()
  {
    MacroDefImpl macroDef = new MacroDefImpl();
    return macroDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ParamDef createParamDef()
  {
    ParamDefImpl paramDef = new ParamDefImpl();
    return paramDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AbstractStmt createAbstractStmt()
  {
    AbstractStmtImpl abstractStmt = new AbstractStmtImpl();
    return abstractStmt;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleStmt createSimpleStmt()
  {
    SimpleStmtImpl simpleStmt = new SimpleStmtImpl();
    return simpleStmt;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LoopStmt createLoopStmt()
  {
    LoopStmtImpl loopStmt = new LoopStmtImpl();
    return loopStmt;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public MacroCall createMacroCall()
  {
    MacroCallImpl macroCall = new MacroCallImpl();
    return macroCall;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BfValue createBfValue()
  {
    BfValueImpl bfValue = new BfValueImpl();
    return bfValue;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SignedInt createSignedInt()
  {
    SignedIntImpl signedInt = new SignedIntImpl();
    return signedInt;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AbstractParamDef createAbstractParamDef()
  {
    AbstractParamDefImpl abstractParamDef = new AbstractParamDefImpl();
    return abstractParamDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BlockStmt createBlockStmt()
  {
    BlockStmtImpl blockStmt = new BlockStmtImpl();
    return blockStmt;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleStmtKind createSimpleStmtKindFromString(EDataType eDataType, String initialValue)
  {
    SimpleStmtKind result = SimpleStmtKind.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertSimpleStmtKindToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BrainfuckLanguagePackage getBrainfuckLanguagePackage()
  {
    return (BrainfuckLanguagePackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static BrainfuckLanguagePackage getPackage()
  {
    return BrainfuckLanguagePackage.eINSTANCE;
  }

} //BrainfuckLanguageFactoryImpl
